package cn.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import cn.mapper.DetailMapper;
import cn.pojo.Detail;

@Service
@Transactional
public class DetailServiceImpl implements DetailService {

	@Resource
	private DetailMapper detailMapper;

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public Detail getDetailById(Long id) {
		// TODO Auto-generated method stub
		return detailMapper.getDetailById(id);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public int updateDetailById(Long id, int i) {
		// TODO Auto-generated method stub
		return detailMapper.updateDetailById(id, i);
	}

	@Override
	public Integer totalCount(Long sortId) {
		return detailMapper.totalCount(sortId);
	}

	@Override
	public List<Detail> getDetails(Long sortId, Integer rowNum, int pagecount) {
		return detailMapper.getDetails(sortId, rowNum, pagecount);
	}

}
